#include "checkbox.h"

Checkbox::Checkbox()
{
}

void Checkbox::draw()
{
	if (active)
	{
		drawBackground();
		drawBorders();
		if ( *settingPointer )
			drawChildren();
	}
}

void Checkbox::genEvent(const int& button, const std::string& name, const cmdsettings& cmds, EventProperty_Repeat repeat, unsigned int delay )
{
	eventname = name;
	buttonlist[button] = BeEventSystem::Instance()->registerEvent( eventname, boost::shared_ptr<Event>(new Event( cmds, repeat, delay) ) );
	settingPointer = settings->getCVarPtr( cmds.args );
}

void Checkbox::genEvent(const int& button, const std::string& name, const cmdsettings& cmds, const std::string& settingname, EventProperty_Repeat repeat, unsigned int delay )
{
	eventname = name;
	buttonlist[button] = BeEventSystem::Instance()->registerEvent( eventname, boost::shared_ptr<Event>(new Event( cmds, repeat, delay) ) );
	settingPointer = settings->getCVarPtr( settingname );
}


Checkbox::~Checkbox()
{
}
